package com.sulent.frame.web.common;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName KafkaConsumerListener
 * @Description: TODO
 * @Author Submerge.
 * @Since 2025/6/13 11:56
 * @Version 1.0
 */
@Component
public class KafkaConsumerListener {

    @KafkaListener(topics = "sulent-frame-web-str")
    public void strListener(String message) {
        System.out.println("strListener consumer message:"+message);
    }

    @KafkaListener(topics = "sulent-frame-web-obj")
    public void objListener(String message) {
        JSONObject jsonObject = JSONUtil.parseObj(message);
        System.out.println("objListener consumer message:"+jsonObject);
    }

}
